﻿using System;

namespace Borg
{
    [Serializable]
    public class ParamDefinition : Qualifiable
    {
        internal static readonly object NoDefault = new object();

        private SlotDefinition _slotDefinition;
        private string _typeName;
        private Param _defaultParam;

        public SlotDefinition SlotDefinition
        {
            get { return _slotDefinition; }
            internal set { _slotDefinition = value; }
        }

        public string TypeName
        {
            get { return _typeName; }
            internal set { _typeName = value; }
        }

        public Param DefaultParam
        {
            get { return _defaultParam; }
            internal set { _defaultParam = value; }
        }

        public override bool IsQualified
        {
            get { return Qualifier.IsQualified(this); }
        }

        static ParamDefinition()
        { }

        public ParamDefinition(int id, string name)
            : base(id, name)
        { }

        public override bool Qualify()
        {
            return Qualifier.Qualify(this);
        }

        internal override AssemblyElement GetAssemblyElement()
        {
            return SlotDefinition.Contract;
        }
    }
}
